package router

import (
	"github.com/gin-gonic/gin"
	"net/http"
	"post-admin/handler"
)

func Init() *gin.Engine {
	r := gin.Default()
	r.GET("/", func(c *gin.Context) {
		c.String(http.StatusOK, "hello World!")
	})
	r.POST("login", handler.Login)
	r.GET("list", handler.ListPost)
	r.GET("detail", handler.Detail)
	return r

}
